<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateCruiseCheckSelfTaskTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cruise_check_self_task', function (Blueprint $table) {
            $table->id();
            $table->string('name', 32)->default('')->comment('任务名称');
            $table->unsignedTinyInteger('rule')->default(0)->comment("1:每日1次");
            $table->unsignedInteger('taskStartTime')->default(0)->comment('任务开始时间');
            $table->unsignedInteger('taskEndTime')->default(0)->comment('任务结束时间');
            $table->time('executeStartHis')->default(0)->comment('执行开始时间');
            $table->time('executeEndHis')->default(0)->comment('执行结束时间');
            $table->unsignedInteger('templateId')->default(0)->comment('巡检模板id');
            $table->tinyInteger('status')->default(0)->comment('0停用 1启用');

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->tinyInteger('isDeleted')->default(0)->comment('');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '稽核 - 自检任务';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('cruise_check_self_task');
    }
}
